package com.hxd.otc.module.order.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hxd.otc.R;
import com.hxd.otc.module.order.bean.AdOrderDetailBean;

/**
 * 包  名 :  com.hxd.otc.module.order.adapter
 * 类  名 :  OrderDetailBankAdapter
 * 作  者 :  zjl
 * 时  间 :  2018/6/15 17:42
 * 描  述 :  ${TODO}订单详情页---银行卡信息
 */
public class AdOrderDetailBankAdapter extends BaseQuickAdapter<AdOrderDetailBean.BankInfoPoData, BaseViewHolder> {

    public AdOrderDetailBankAdapter() {
        super(R.layout.adapter_order_detail_bank, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, AdOrderDetailBean.BankInfoPoData item) {
        helper.setText(R.id.tv_bank_name, item.bankName);
        helper.setText(R.id.tv_name, item.name);
        helper.setGone(R.id.tv_remark, !TextUtils.isEmpty(item.remark));
        helper.setText(R.id.tv_remark, item.remark);
        helper.setText(R.id.tv_bank_number, item.bankNo);
        switch (item.type) {
            case 0:
                helper.setImageResource(R.id.iv_bank, R.mipmap.order_sell_bank_domestic);
                break;
            case 1:
                helper.setImageResource(R.id.iv_bank, R.mipmap.order_sell_bank_paypal);
                break;
            case 2:
                helper.setImageResource(R.id.iv_bank, R.mipmap.order_sell_westernunion);
                break;
            case 3:
                helper.setImageResource(R.id.iv_bank, R.mipmap.order_sell_abroad);
                break;
        }
    }
}
